import { http } from "@/utils/http";
import type { HttpResult } from "@/utils/http/types";

export function queryPage(query?: object) {
  return http.request<HttpResult>("get", "/esflow/order/inst/gettable", {
    params: query
  });
}

export function getObj(id: string) {
  return http.request<HttpResult>("get", `/esflow/order/inst/getdetail/${id}`);
}

export function delObjs(id: string) {
  return http.request<HttpResult>("delete", `/esflow/order/inst/delete/${id}`);
}

export function saveCraft(obj?: object) {
  return http.request<HttpResult>("post", "/esflow/order/inst/insert/craft", {
    data: obj
  });
}

export function updateFormData(obj?: object) {
  return http.request<HttpResult>("post", "/esflow/order/inst/update/form", {
    data: obj
  });
}

export function saveStart(obj?: object) {
  return http.request<HttpResult>("post", "/esflow/order/inst/insert/start", {
    data: obj
  });
}
